package com.teach.service.impl;

import com.teach.entity.Product;
import com.teach.mapper.ProductMapper;
import com.teach.service.ProductService;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <pre>
 * TODO : 业务逻辑实现类
 * 产品
 * ClassName : com.teach.service.impl.ProductServiceImpl
 * Author : J.L.Zhou
 * Tel : 15111047708
 * E-Mail : 12020042@qq.com
 * Date : 2020-05-02 12:53
 * Version : 1.0
 * </pre>
 */
@Service
public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements ProductService {

	@Override
	public QueryWrapper<Product> getQueryWrapper(Product product) {
		QueryWrapper<Product> queryWrapper = new QueryWrapper<Product>();
		if(product.getProductId() != null) {
			queryWrapper.eq("PRODUCT_ID", product.getProductId());
		}
		if(product.getProductName() != null) {
			queryWrapper.eq("PRODUCT_NAME", product.getProductName());
		}
		if(product.getProductPrice() != null) {
			queryWrapper.eq("PRODUCT_PRICE", product.getProductPrice());
		}
		if(product.getProductNum() != null) {
			queryWrapper.eq("PRODUCT_NUM", product.getProductNum());
		}
		if(product.getProductImgs() != null) {
			queryWrapper.eq("PRODUCT_IMGS", product.getProductImgs());
		}
		if(product.getProductContent() != null) {
			queryWrapper.eq("PRODUCT_CONTENT", product.getProductContent());
		}
		if(product.getProductTime() != null) {
			queryWrapper.eq("PRODUCT_TIME", product.getProductTime());
		}
		if(product.getProductOut() != null) {
			queryWrapper.eq("PRODUCT_OUT", product.getProductOut());
		}
		return queryWrapper;
	}
	

}
